<template slot-scope="scope">
  <el-icon v-if="'1' === orientation" color="#F56C6C" @click="change('2')" style="cursor: pointer;">
    <CaretTop />
  </el-icon>
  <el-icon v-else-if="'2' === orientation" color="#F56C6C" @click="change('0')" style="cursor: pointer;">
    <CaretBottom />
  </el-icon>
  <el-icon v-else color="#409EFF" @click="change('1')" style="cursor: pointer;">
    <DCaret />
  </el-icon>
</template>

<script setup>
import { ref } from "vue"

const props = defineProps({
  columnCode: String,
})

const emits = defineEmits(['changeSort'])

const orientation = ref("0")

const change = (val) => {
  //console.log(props.columnCode, val)
  orientation.value = val
  emits('changeSort', props.columnCode, val)
}

</script>
